package com.hisysteTopet.hisystepet.utils;

import io.netty.util.Constant;
import org.springframework.util.DigestUtils;

// 使用密钥+MD5加密
public class MD5Util {

	public static final String MD5_KEY = "xuernuo";

	public static final String MD5_VALUE = "haq";

	public static String getMD5(String str) {
		if (str.equals(" ")){
			return null;
		}
		String md5 = DigestUtils.md5DigestAsHex(str.getBytes());
		return md5;
	}

	public static void main(String[] args) {

		System.out.println(getMD5("123"));
		System.out.println(getMD5("xuernuo"));
		System.out.println(getMD5("123"+"xuernuo"));
		System.out.println(getMD5("123")+getMD5("xuernuo"));
	}

}
